package text;
class Animal
{
    int age;
    String name;
    public Animal(String name,int age)
    {
        this.name=name;
        this.age=age;
    }

    public void eat()
    {
        System.out.println(name+"吃饭");
    }
}
class Dog extends Animal
{
    String name;
    int age;
    String silly;
    public Dog(String name,int age)
    {
        super(name,age);
        this.silly="笨";
        this.name=name;

    }
    public void eat()
    {
        System.out.println(name+"吃狗粮");
    }


}
class  Bird extends Animal
{
    String name;
    int age;
    public Bird(String name,int age)
    {

        super(name,age);
        this.name=name;
    }
    //String name;
    public void fly()
    {
        System.out.println(name+"正在飞");
    }
    public void eat()
    {
        System.out.println(name+"正在吃鸟粮");
    }


}
  public class text {
    public static void animaleat(Animal animal)
    {
        animal.eat();
    }
      public static void main(String[] args) {
          Dog dog=new Dog("bi",4);

          animaleat(dog);
          animaleat(new Bird("be",9));






      }


  }






